<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
div {
	width: 200px;
	height: 200px;
	border: 1px solid red;
}
</style>
</head>
<body>
  <div onmouseover="overfn()" onmouseout="outfn()"
    onmousedown="downfn()" onmouseup="upfn()" onmousemove="movefn()">这是div</div>
  <input type="button" value="按钮" onclick="myfn()">
  <script type="text/javascript">
			function upfn() {
				console.log("鼠标抬起了")
			}
			function movefn() {
				console.log("鼠标移动了")
			}
			function downfn() {
				console.log("鼠标按下了")
			}
			function outfn() {
				console.log("鼠标移出了")
			}
			function overfn() {
				console.log("鼠标移入了")
			}
			function myfn() {
				//3秒后执行
				setTimeout(function() {
					alert("早上好!")
				}, 3000)
			}
		</script>
</body>
</html>